<template>
    <Container class="no-find bg-light">
        <Tabs v-model="tab">
            <TabPane label="优惠券激活" name="tab1">
                <div style="padding-left:40px;">
                    <div class="mb">
                        <p class="mb">查看条码入库激活优惠券情况</p>
                        <div class="fleft mb">
                            <span style="flex: 0 0 80px;">条码： </span><Input v-model="barcode" style="width: 400px" enter-button placeholder="输入条码" />
                        </div>
                        <div class="fleft mb">
                            <span style="flex: 0 0 80px;">订单编号： </span><Input v-model="orderSn" style="width: 400px" enter-button placeholder="订单编号" />
                        </div>
                        <div style="padding-left: 80px;">
                            <Button :loading='btnLoading' type="primary" @click="getData4">搜索</Button>
                        </div>
                    </div>
                    <p>返回参数</p>
                    <div class="mt ps border" style="color:red">
                        {{resData || '暂无'}}
                    </div>
                </div>
            </TabPane>
        </Tabs>
    </Container>
</template>
<script>
    export default {
        data() {
            return {
                resData: '',
                tab: 'tab1',
                orderSn: '',
                barcode: '',
                btnLoading: false
            }
        },
        methods: {
            getData4(v) {
                this.$Message.info('请求中')
                let params = {
                    barcode: this.barcode,
                    orderSn: this.orderSn
                }
                this.btnLoading = true
                this.$ajaxGet(`/backend/checkBarcodeStockInScan`, params).then(res => {
                    this.resData = (res || {}).matchResultStr
                    this.btnLoading = false
                }).catch(() => {
                    this.btnLoading = false
                })
            },
            jumpPrevPage() {
                this.$router.back();
            },
            jumpHomePage() {
                this.$router.push({
                    name: "home"
                })
            }
        }
    }
</script>

